Machine go brrrrr

Making analysis easy and fun with computational statistics and Bayesian inference

Mark Rieke

2024-11-16

Who took stats?

Who liked stats?

What do we use stats for?

  • Pose a question
  • Estimate a value
  • Quantify uncertainty

Most stats courses look like this

This sucks

  • Statistics becomes “a box to check”
  • These procedures are brittle!
  • It’s really easy to mess up!

What works better?

Simulation!

What do we use stats for?

  • Pose a question
  • Estimate a value
  • Quantify uncertainty

How can we use simulation for statistics?

  • Frame question in terms of a process
  • Use random number generators to generate an answer
  • Do this a bunch of times
  • Quantify uncertainty

Example: weighting surveys

An example pre-election survey
Proportion of each subgroup that support the democratic candidate
party gender population K Y group mean sample proportion weight
Democrat Women 28% 237 229 97% 34% 0.83
Democrat Men 22% 178 160 90% 25% 0.87
Republican Women 25% 161 18 11% 23% 1.09
Republican Men 25% 124 4 3% 18% 1.41

Example: weighting surveys

Example: weighting surveys

Example: weighting surveys

Example: weighting surveys

Example: weighting surveys

model {
  Y ~ binomial(K, theta);
  wt_mean = sum(theta * wt * K) / sum(wt * K);
}

Example: weighting surveys

model {
  Y ~ binomial(K, theta);
  wt_mean = sum(theta * wt * K) / sum(wt * K);
}

Example: weighting surveys

model {
  Y ~ binomial(K, theta);
  wt_mean = sum(theta * wt * K) / sum(wt * K);
}

Problem

  • a;sdlkfjasdklfj

Solution

  • FDSKFJKJD
  • askfjal;sfjk